package com.moranyunxi.www;

import io.webfolder.cdp.Launcher;
import io.webfolder.cdp.session.Session;
import io.webfolder.cdp.session.SessionFactory;

import java.util.ArrayList;

public class Main {
    public static void main(String[] args) {
        final String url = "https://mp.weixin.qq.com/s/XspiwxL9eEGmpPZxxBelbA";

        ArrayList<String> command = new ArrayList<String>();
        //不显示google 浏览器
        command.add("--headless");
        Launcher launcher = new Launcher();
        try (SessionFactory factory = launcher.launch(command);
             Session session = factory.create()) {
            session.navigate(url);
            session.waitDocumentReady();
            String content = (String) session.getContent();
            System.out.println(content);
            //已经拿到渲染后的html，下面就可以用jsoup去抓取想要的数据了
        }
    }
}
